﻿/*
 * 跟业务没有关系的公共函数库
 */
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace lymis.ComMon
{
    public class CommonCode
    {
        public CommonCs()
        {

        }

        /// <summary>
        /// 空行显示gridview标题,在datatable中没有数据的情况下,把绑定的Gridview的标题显示出来
        /// </summary>
        /// <param name="BindDT">绑定的数据表</param>
        /// <param name="BindGrid">绑定的gridview</param>
        public static void DataNullRow(System.Data.DataTable BindDT, GridView BindGrid)
        {
            DataRow dr = BindDT.NewRow();
            BindDT.Rows.Add(dr);
            BindGrid.DataSource = BindDT;
            BindGrid.DataBind();
            BindGrid.Rows[0].Controls.Clear();
        }

        /// <summary>
        ///  空行显示SmartGridView标题,在datatable中没有数据的情况下,把绑定的SmartGridView的标题显示出来
        /// </summary>
        /// <param name="BindDT">绑定的数据表</param>
        /// <param name="BindGrid">绑定的SmartGridView</param>
        public static void DataNullRow(System.Data.DataTable BindDT, YYControls.SmartGridView BindGrid)
        {
            DataRow dr = BindDT.NewRow();
            BindDT.Rows.Add(dr);
            BindGrid.DataSource = BindDT;
            BindGrid.DataBind();
            BindGrid.Rows[0].Controls.Clear();
        }


    }

}
